package com.xprophet.crs.jpeg.codec.model;

import java.io.Serializable;

import com.xprophet.crs.jpeg.codec.FingerprintType;

public class Fingerprint implements Serializable, Cloneable {

	private static final long serialVersionUID = -9213778545642570324L;

	/*
	 * Origin columns in sign.txt type, x_make, x_model, um_qual, c_sig, c_sigrot, x_subsamp, m_swtrim, m_swdisp
	 */
	protected int type = FingerprintType.NONE;

	protected String make = "";

	protected String model = "";

	protected String um_quality = "";

	protected String snoop_sig = "";

	protected String snoop_sig_rot = "";

	protected String x_sig = "";

	protected String x_sig_rot = "";

	protected String subsamp = "";

	protected String swtrim = "";

	protected String swdisp = "";

	protected String editor = "";

	public int getType() {
		return type;
	}

	public void setType(int type) {
		this.type = type;
	}

	public String getMake() {
		return make;
	}

	public void setMake(String make) {
		this.make = make == null ? "" : make;
	}

	public String getModel() {
		return model;
	}

	public void setModel(String model) {
		this.model = model == null ? "" : model;
	}

	public String getUm_quality() {
		return um_quality;
	}

	public void setUm_quality(String um_quality) {
		this.um_quality = um_quality == null ? "" : um_quality;
	}

	public String getSnoop_sig() {
		return snoop_sig;
	}

	public void setSnoop_sig(String snoop_sig) {
		this.snoop_sig = snoop_sig == null ? "" : snoop_sig;
	}

	public String getX_sig() {
		return x_sig;
	}

	public void setX_sig(String x_sig) {
		this.x_sig = x_sig == null ? "" : x_sig;
	}

	public String getSnoop_sig_rot() {
		return snoop_sig_rot;
	}

	public void setSnoop_sig_rot(String snoop_signature_rotate) {
		this.snoop_sig_rot = snoop_signature_rotate;
	}

	public String getX_sig_rot() {
		return x_sig_rot;
	}

	public void setX_sig_rot(String x_signature_rotate) {
		this.x_sig_rot = x_signature_rotate;
	}

	public String getSubsamp() {
		return subsamp;
	}

	public void setSubsamp(String subsamp) {
		this.subsamp = subsamp;
	}

	public String getSwtrim() {
		return swtrim;
	}

	public void setSwtrim(String swtrim) {
		this.swtrim = swtrim;
	}

	public String getSwdisp() {
		return swdisp;
	}

	public void setSwdisp(String swdisp) {
		this.swdisp = swdisp;
	}

	public String getEditor() {
		return editor;
	}

	public void setEditor(String editor) {
		this.editor = editor == null ? "" : editor;
	}

	@Override
	public Fingerprint clone() {
		Fingerprint o = new Fingerprint();
		o.setType(type);
		o.setMake(make);
		o.setModel(model);
		o.setEditor(editor);
		o.setUm_quality(um_quality);
		o.setSnoop_sig(snoop_sig);
		o.setSnoop_sig_rot(snoop_sig_rot);
		o.setX_sig(x_sig);
		o.setX_sig_rot(x_sig_rot);
		o.setSubsamp(subsamp);
		o.setSwtrim(swtrim);
		o.setSwdisp(swdisp);
		return o;
	}
	
	public void cloneHardware(Fingerprint o) {
		if (o != null) {
			o.setType(type);
			o.setMake(make);
			o.setModel(model);
			o.setUm_quality(um_quality);
			o.setSubsamp(subsamp);
		}
	}
	
	public void cloneSoftware(Fingerprint o) {
		if (o != null) {
			o.setType(type);
			o.setMake(make);
			o.setEditor(editor);
			o.setUm_quality(um_quality);
			o.setSwtrim(swtrim);
			o.setSwdisp(swdisp);
		}
	}

	@Override
	public String toString() {
		return type + ":" + make + " | " + model + " | " + editor;// + "_" + um_quality;
	}

}
